#ifndef __PDVD_MARCO__H
#define __PDVD_MARCO__H

#ifndef SAFE_DELETE
#define SAFE_DELETE(p)       { if(p) { delete (p);     (p)=NULL; } }
#endif

#ifndef SAFE_DELETE_ARRAY
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p);   (p)=NULL; } }
#endif

#ifndef SAFE_RELEASE
#define SAFE_RELEASE(p)      { if(p) { (p)->Release(); (p)=NULL; } }
#endif

#ifndef SAFE_DELETE_OBJECT
#define SAFE_DELETE_OBJECT(obj)	{ if(obj) { DeleteObject(obj); (obj)=NULL; } }
#endif

#ifndef SAFE_DELETE_DC
#define SAFE_DELETE_DC(dc) { if(dc) { DeleteDC(dc); (dc)=NULL; } }
#endif

#ifndef SAFE_CLOSE_HANDLE
#define SAFE_CLOSE_HANDLE(h) { if(h) { CloseHandle(h); (h)=NULL; } }
#endif


#define RETURN_IF_FAILED(x) {if(FAILED(x)) return false;}
#define CONTINUE_IF_FAILED(x) {if(FAILED(x)) continue;}


#endif
